<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>供应商平台</title>
</head>
<body class="tob-wrap">
	<div th:replace="common/top"></div>
	<article class="container container-c51-create-order clearfix">
		<div th:replace="common/left::c_side"></div>
		<section class="content">
			<div class="m-crumb">
				<p>
					<a href="#">订单管理 > </a> <span>新建订单</span>
				</p>
			</div>
			<div class="m-table-sell">
				<div class="m-table-cont">
					<input id="purchaseOrderId" type="hidden"
						th:value="${purchaseOrderId}" />
					<table width="100%" summay="" cellpadding="0" cellspacing="0">
						<thead>
							<tr>
								<th>序号</th>
								<th>描述</th>
								<th>计划金额</th>
								<th>实际金额</th>
								<th>操作</th>
								<th>合计及校对金额</th>
							</tr>
						</thead>
						<tbody>
							<tr
								th:each="purchaseOrderPayment, purchaseOrderPaymentStat: ${purchaseOrderPaymentList}">
								<td th:text="${purchaseOrderPaymentStat.count}"></td>
								<td th:text="${purchaseOrderPayment.orderPaymentRemark}"></td>
								<td th:text="'￥'+${purchaseOrderPayment.planAmount}"></td>
								<td th:text="'￥'+${purchaseOrderPayment.paidAmount}">2000000</td>
								<td><a
									th:onclick="'javascript:openEditPurchaseOrderPayment(this, \''+${purchaseOrderPayment.id}+'\');'"><i
										class="icon icon-tr-open"></i> 展开编辑</a> <a
									th:onclick="'javascript:closeEditPurchaseOrderPayment(this);'"
									style="display: none;" data-trid="tr003"><i
										class="icon icon-tr-close"></i> 收起编辑</a></td>
								<td th:if="${purchaseOrderPaymentStat.index == 0}"
									class="vaT txL" rowspan="5" style="border-bottom: none">
									<p>
										<strong class="orange">1234567890.00</strong>
									</p>
									<p>
										校对金额：<br />2000000.00
									</p>
								</td>
							</tr>
							<tr
								th:replace="client/jq-template/template::purchaseOrderPayment">
							</tr>
						</tbody>
					</table>
				</div>
			</div>
			<div class="m-table-sell m-table-sell-inputs">
				<div class="m-table-cont">
				<form id="purchaseOrderItemForm">
					<table width="100%" summay="" cellpadding="0" cellspacing="0">
						<thead>
							<tr>
								<th>序号</th>
								<th>商品</th>
								<th>计划数量</th>
								<th>已发出数量</th>
								<th>已确认数量</th>
								<th>单位</th>
								<th>要求到货时间</th>
								<th>实际到货时间</th>
							</tr>
						</thead>
						<tbody>
							<tr
								th:each="purchaseOrderItem, purchaseOrderItemStat: ${purchaseOrderItemList}">
								<input type="hidden" th:value="${purchaseOrderItem.id}" name="id"/>
								<input type="hidden" th:value="${purchaseOrderItem.orderItemNo}" name="orderItemNo"/>
								<td th:text="${purchaseOrderItemStat.count}"></td>
								<td>
									<input class="w80 input" type="text" placeholder="商品名称" th:value="${purchaseOrderItem.tMaterialMasterClient.materialName}"/>
								</td>
								<td>
									<input class="w80 input" type="text" placeholder="计划数量" value="数据库中无字段" />
								</td>
								<td>
									<input class="w80 input" type="text" placeholder="已发出数量" th:value="${purchaseOrderItem.quantityDelivered}" name="quantityDelivered"/>
								</td>
								<td>
									<input class="w80 input" type="text" placeholder="已确认数量" th:value="${purchaseOrderItem.quantityConfirmed}" name="quantityConfirmed"/>
								</td>
								<td>
									<select class="select" name="unitId" >
										<option th:each="unit : ${unitList}" th:value="${unit.id}" th:text="${unit.unitName}" th:selected="${unit.id == purchaseOrderItem.tMaterialMasterClient.tUnit.id}">Unit</option>
									</select>
								</td>
								<td>
									<p class="p-calendar">
										<input class="w80 input input-datepicker" type="text" th:value="${purchaseOrderItem.planedTime}" name="planedTime"/>
										<i class="icon icon-calendar"></i>
									</p>
								</td>
								<td>
									<p class="p-calendar">
										<input class="w80 input input-datepicker" type="text" th:value="${purchaseOrderItem.actualTime}" name="actualTime"/>
										<i class="icon icon-calendar"></i>
									</p>
								</td>
							</tr>
						</tbody>
					</table>
					</form>
				</div>
			</div>
			<div class="btn-bar">
				<a class="btn btn-cyan btn-small" onclick="javascript: addPurchaseOrderItem();">+ 增加</a>
				<a class="btn btn-orange btn-small" onclick="javascript: delPurchaseOrderItem();">- 删除</a>
			</div>
			<div class="btn-bar txC">
				<a class="btn btn-cyan btn-large" href="#">确定修改并返回</a>
			</div>
			<div th:replace="client/jq-template/template::purchaseOrderItem">
			</div>
		</section>
	</article>
</body>
<script data-main="../js/page/b1_supplier"
	src="../lib/requirejs/require.js"></script>
<script type="text/javascript" src="../lib/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="../lib/jquery-tmpl/jquery.tmpl.js"></script>
<script type="text/javascript" src="../js/customer/customer.js"></script>
</html>